Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix failed metric names. #54

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

dashmage
Copy link
Contributor

@dashmage dashmage commented Dec 1, 2023

Previously, the failed collector metric had "collector" twice in its name.
Eg: "ipmidcmicollector_collector_failed"

This change aims to remove the duplication.
Previous example becomes "ipmidcmi_collector_failed"

Also,

  • Change label to reflect the new name.
  • Modify unit test
  • Remove test numbers for tests in test_collector.py

@dashmage
Copy link
Contributor Author

dashmage commented Dec 1, 2023

Alert rules changed here: canonical/hardware-observer-operator#121

@dashmage dashmage force-pushed the refactor/fix-metric-names branch from 25448da to 8a6afe2 Compare December 1, 2023 14:28
Previously, the failed metric had "collector" twice in its name.
Eg: "ipmidcmicollector_collector_failed"

This change aims to remove the duplication.
Previous example becomes "ipmidcmi_collector_failed"

The label is also changed similarly to reflect the new name.

Unit test was also modified to reflect this change.
@dashmage dashmage force-pushed the refactor/fix-metric-names branch from 8a6afe2 to 76ae3b7 Compare December 1, 2023 16:21
Copy link
Contributor

@rgildein rgildein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small improvement to make code more readable.

prometheus_hardware_exporter/core.py Outdated Show resolved Hide resolved
Copy link
Contributor

@rgildein rgildein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dashmage dashmage merged commit 60d9ffb into canonical:main Dec 5, 2023
3 checks passed
@dashmage dashmage deleted the refactor/fix-metric-names branch December 5, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix duplication in metric names for failed collectors
4 participants